#pragma once
#include <iostream>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <string>
#include <log/log.h>

using namespace std;

namespace android::wmark
{
    class Device
    {
    public:
        Device(string dev, int openFlag = O_RDWR);
        ~Device();

    protected:
        string mDev;
        int mOpenFlag;
        int mFd = -1;
        int openDev(int openFlag);
        int getFd();
    
    private:
        std::mutex m_mutex;

    public:
        int ioctlDev(unsigned long cmd, void *msg);
    };
}